

#ifndef CONFIGWRITERXML_H
#define CONFIGWRITERXML_H

#include "ConfigOperatorIf.h"
#include "ConfigWriterIf.h"

class TiXmlElement;
class TiXmlDocument;
namespace woe
{
	class TUTIL_API ConfigWriterXML : public IConfigWriter
	{
	public:
		ConfigWriterXML();
		virtual ~ConfigWriterXML();


		/**
		* DoSave
		* 
		* @param config 
		* @return bool 
		*/
		virtual bool DoSave(const std::string& strFileName,  IConfigOperator* config);

		static ConfigWriterXML* GetInstance();

	private:
		TiXmlElement* FindOrCreateElement(TiXmlDocument& doc, const std::string& elemName, TiXmlElement* parentElement);

		//CRITICAL_SECTION			m_csWriteXml;
		static ConfigWriterXML*	m_Instance;
	};
}

#endif // CONFIGWRITERXML_H
